negotiator.boaframework
Class SortedOutcomeSpace

java.lang.Object
  extended by negotiator.boaframework.OutcomeSpace
      extended by negotiator.boaframework.SortedOutcomeSpace

public class SortedOutcomeSpace
extends OutcomeSpace

This class is an OutcomeSpace but with a sorted list of BidDetails based on the utility Methods have been optimized to work with a sorted list. Useful if someone wants to quickly implement an agent.

Author:
Alex Dirkzwager, Mark Hendrikx

Constructor Summary
SortedOutcomeSpace(UtilitySpace utilSpace)
          Instantiates a SortedOutcomeSpace: an enumeration of all possible bids in the domain which can be efficiently searched using the provided methods.
 
Method Summary
 BidDetails getBidNearUtility(double utility)
          Gets a BidDetails which is close to the utility
 java.util.List<BidDetails> getBidsinRange(Range r)
          gets a list of BidDetails that have a utility within the range
 int getIndexOfBidNearUtility(double utility)
          Gets a BidDetails which is close to the utility
 BidDetails getMaxBidPossible()
           
 BidDetails getMinBidPossible()
           
 int searchIndexWith(double value)
          Binary search of a BidDetails with a particular value if there is no BidDetails with the exact value gives the last index because this is the closest BidDetails to the value
 
Methods inherited from class negotiator.boaframework.OutcomeSpace
generateAllBids, getAllOutcomes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortedOutcomeSpace

public SortedOutcomeSpace(UtilitySpace utilSpace)
Instantiates a SortedOutcomeSpace: an enumeration of all possible bids in the domain which can be efficiently searched using the provided methods.

Parameters:
utilSpace - utilityspace of the agent.
Method Detail

getBidsinRange

public java.util.List<BidDetails> getBidsinRange(Range r)
gets a list of BidDetails that have a utility within the range

Overrides:
getBidsinRange in class OutcomeSpace
Parameters:
r -
Returns:
A list of BidDetails

getBidNearUtility

public BidDetails getBidNearUtility(double utility)
Gets a BidDetails which is close to the utility

Overrides:
getBidNearUtility in class OutcomeSpace
Parameters:
utility -
Returns:
BidDetails

getIndexOfBidNearUtility

public int getIndexOfBidNearUtility(double utility)
Gets a BidDetails which is close to the utility

Overrides:
getIndexOfBidNearUtility in class OutcomeSpace
Parameters:
utility -
Returns:
BidDetails

searchIndexWith

public int searchIndexWith(double value)
Binary search of a BidDetails with a particular value if there is no BidDetails with the exact value gives the last index because this is the closest BidDetails to the value

Parameters:
value -
Returns:
index

getMaxBidPossible

public BidDetails getMaxBidPossible()
Overrides:
getMaxBidPossible in class OutcomeSpace
Returns:
best bid in the domain.

getMinBidPossible

public BidDetails getMinBidPossible()
Overrides:
getMinBidPossible in class OutcomeSpace
Returns:
worst bid in the domain.